package com.cb.domain.dao.order.impl;

import java.util.List;
import java.util.ArrayList;
import org.springframework.stereotype.Repository;
import com.cb.core.dao.hibernate.GenericDAOHibernate;
import com.cb.domain.model.order.OrderLog;
import com.cb.domain.dao.order.OrderLogDAO;
import com.cb.core.webapp.paging.PagingBean;

@Repository
public class OrderLogDAOImpl extends GenericDAOHibernate<OrderLog, Long> implements OrderLogDAO {
	public OrderLogDAOImpl() {
		super(OrderLog.class);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public List<OrderLog> getByVo(OrderLog vo, PagingBean pb) {
		List<Object>paramList=new ArrayList<Object>();
		String hql="from OrderLog vo where 1=1";
		
		/**TODO 添加自己的需要加入的查询条件
		if(StringUtils.isNotEmpty(vo.getUsername())){
			hql+=" and vo.username like ?";
			paramList.add("%"+vo.getUsername()+"%");
		}**/
		
		List <OrderLog>list=this.find(hql, paramList.toArray(), pb);
		return list;
	}
}

